﻿
@{
    ViewBag.Title = "Index";
}

@section css{

    <link href="~/Content/css/dataTables.bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
}
@section scripts{
    <script src="~/Content/js/plugins/jquery.dataTables/jquery.dataTables.js"></script>
    <script src="~/Content/js/plugins/dataTables.bootstrap/dataTables.bootstrap.js"></script>
    <script type="text/javascript">
        $(function () {
            //$('#example2').DataTable({
            //    "ajax": '/SystemModule/User/GetUserList',
            //    "columns": [
            //        { "data": "Account", "orderable": false },
            //        { "data": "RealName", "orderable": false },
            //        { "data": "Gender" },
            //        { "data": "MobilePhone" },
            //        { "data": "OrganizeId" },
            //        { "data": "DepartmentId" },
            //        { "data": "DutyId" },
            //        { "data": "DutyId"},
            //        { "data": "CreatorTime" },
            //        { "data": "Description" }
            //    ]
            //});
            $('#example2').DataTable({
                'paging': true,
                'lengthChange': false,
                'searching': false,
                'ordering': true,
                'info': true,
                'autoWidth': true,
                'iDisplayLength': 10,
                'bProcessing': true,
                "language": {
                    "processing": "玩命加载中...",
                    "lengthMenu": "显示 _MENU_ 项结果",
                    "zeroRecords": "没有匹配结果",
                    "info": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                    "infoEmpty": "显示第 0 至 0 项结果，共 0 项",
                    "infoFiltered": "(由 _MAX_ 项结果过滤)",
                    "infoPostFix": "",
                    "search": "搜索:",
                    "paginate": {
                        "first": "首页",
                        "previous": "上页",
                        "next": "下页",
                        "slast": "末页"
                    }
                },
                "ajax": {
                    "type": "post",
                    "url": "/SystemModule/User/GetUserList",
                    "dataType": "json"
                },
                "columns": [
                    { "data": "Account", width: '60px' },
                    { "data": "RealName", width: '60px' },
                    { "data": "Gender", width: '60px' },
                    { "data": "MobilePhone", width: '60px'},
                    { "data": "OrganizeId", width: '60px'},
                    { "data": "DepartmentId", width: '60px'},
                    { "data": "DutyId", width: '60px'},
                    { "data": "CreatorTime", width: '60px' },
                    { "data": "NickName", width: '60px' },
                    { "data": "Description", width: '60px' }
                ],
                "order": [[1, 'asc']],
                "columnDefs": [
                    {
                        targets: 2,
                        render: function (data, type, rowdata, meta) {
                            if (data == true) {
                                return "男";
                            } else {
                                return "女";
                            }
                        }
                    }
                ]
            })
        })
    </script>

}

<div class="row">
    <!-- Content Header (Page header) -->
    @*<section class="content-header">
            <h1>
                <small>advanced tables</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li><a href="#">Tables</a></li>
                <li class="active">Data tables</li>
            </ol>
        </section>*@
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">Hover Data Table</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <table id="example2" class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th>账户</th>
                                    <th>姓名</th>
                                    <th>性别</th>
                                    <th>手机</th>
                                    <th>公司</th>
                                    <th>部门</th>
                                    <th>岗位</th>
                                    <th>创建时间</th>
                                    <th>允许登录</th>
                                    <th>备注</th>
                                </tr>
                            </thead>

                            <tfoot>
                                <tr>
                                    <th>账户</th>
                                    <th>姓名</th>
                                    <th>性别</th>
                                    <th>手机</th>
                                    <th>公司</th>
                                    <th>部门</th>
                                    <th>岗位</th>
                                    <th>创建时间</th>
                                    <th>允许登录</th>
                                    <th>备注</th>
                                </tr>
                            </tfoot>
                        </table>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
